//开发人员相关操作
import { http } from "@/utils/http";
import { baseUrlApi } from "./utils";

type ResultDevelop = {
  success: boolean;
  data?: Array<any>;
};

type deleteDevelop = {
  isSuccess: boolean;
  data?: Array<any>;
};

type editDevelop = {
  isSuccess: boolean;
  data?: Array<any>;
};

/** 获取开发人员列表 */
export const getDevelopList = (data?: object) => {
  return http.request<ResultDevelop>(
    "post",
    baseUrlApi("System/getDeveloper"),
    { data }
  );
};

/*删除开发人员 */
export const deleteDevelop = (params?: object) => {
  return http.request<deleteDevelop>(
    "post",
    baseUrlApi("System/delDeveloper"),
    { params }
  );
};

/*新增开发人员 */
export const addDevelop = (data?: object) => {
  return http.request<deleteDevelop>(
    "post",
    baseUrlApi("System/saveDevelpoer"),
    { data }
  );
};

/*编辑开发人员 */
export const editDevelops = (params?: object) => {
  return http.request<editDevelop>(
    "post",
    baseUrlApi("System/setDeveloperState"),
    { params }
  );
};
